<div id="form"></div>
<script>
var frm=$("#form").ajajform({
	header: null
});
var grid=frm.ajajform("insertWidget",null,null,{
	type: "grid",
	title: "Каталог продукции",
	name: "market_item",
	rowClasses: [
		{
			name:"item",
			columns: [
				{"name":"name","label":"Название","type":"text","url":"{{action}}?mode=edit&id=",width: 600},
				{"name":"plus","label":"Создать","type":"text",width: 50, url: "{{action}}?mode=edit&parent_id=",cssclass:"href-nodec"},
				{"name":"vendor_id","label":"Производитель","type":"select",width: 200,source:{{JSON_select(0):vendors}}},
				{"name":"price","label":"Цена","type":"number"},
				{"name":"enabled","label":"Вкл","type":"checkbox",width:40},
				{"name":"in_stock","label":"Склад","type":"checkbox",width:60}
			]
		},
		{
			name:"category",
			cssclass: "market-category",
			columns: [
				{"name":"name","label":"Название","type":"text",width: 600},
				{"name":"plus","label":"Создать","type":"text",width: 50, url: "{{action}}?mode=edit&category_id=",cssclass:"href-nodec"}
			]
		}
	],
	rows: {{JSON:rows}}
});
</script>
